package com.ys.controller.api.outer;

import com.ys.service.purchase.Api1688Service;
import com.ys.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 1688接口
 * @author XDH
 *
 */
@CrossOrigin
@Controller
@RequestMapping("/api/outer/1688")
public class ApiOuter1688Controller {
	@Autowired
	private Api1688Service api1688Service;
	
	/**
	 * 下单前预览
	 * @param orderNo 订单号bid
	 * @return
	 */
    @RequestMapping("/viewBeforeCreate")
	@ResponseBody
	public R viewBeforeCreate(String orderNo) {
    	
    	return api1688Service.viewOrderBeforeCreate(orderNo);
	}

	/**
	 * 新增
	 * @throws Exception
	 */
//	@RequiresPermissions("tcwPointTransfer:add")
	@PostMapping("/get1688ProductDetail")
	@ResponseBody
	public R get1688ProductDetail(String code) throws Exception{
		R r = api1688Service.get1688ProductDetail(code);
		return r;
	}
}
